
import {useLocation,useNavigate,useParams,useSearchParams} from "react-router-dom"
import React from "react"

export default function widthRouter(Child){
    return (props)=>{
        const location = useLocation();//window.location
        const navigate = useNavigate();//路由跳转
        const params = useParams();//params参数
        const query = useSearchParams();//获取query参数
        return <Child {...props} location={location} navigate={navigate} params={params} query={query} />
    }
}